home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / TUTORIAL.BIN / LabelHTMLLink.class (.txt) < prev    next >
Encoding:
Java Class File  |  1996-12-16  |  1.4 KB  |  60 lines

  1. package symantec.itools.awt;
  2.  
  3. import java.applet.Applet;
  4. import java.applet.AppletContext;
  5. import java.awt.Component;
  6. import java.awt.Container;
  7. import java.awt.Event;
  8. import java.net.URL;
  9.  
  10. public class LabelHTMLLink extends LabelButton {
  11.    protected URL url;
  12.    protected AppletContext context;
  13.    protected String frame = null;
  14.  
  15.    public URL getURL() {
  16.       return this.url;
  17.    }
  18.  
  19.    public void setURL(URL var1) {
  20.       this.url = var1;
  21.       this.context = null;
  22.    }
  23.  
  24.    public void setFrame(String var1) {
  25.       this.frame = var1;
  26.    }
  27.  
  28.    public String getFrame() {
  29.       return this.frame;
  30.    }
  31.  
  32.    public boolean action(Event var1, Object var2) {
  33.       if (this.context == null) {
  34.          return false;
  35.       } else {
  36.          if (this.frame != null && this.frame.length() != 0) {
  37.             this.context.showDocument(this.url, this.frame);
  38.          } else {
  39.             this.context.showDocument(this.url);
  40.          }
  41.  
  42.          return true;
  43.       }
  44.    }
  45.  
  46.    public void validate() {
  47.       for(Container var1 = ((Component)this).getParent(); var1 != null; var1 = ((Component)var1).getParent()) {
  48.          if (var1 instanceof Applet) {
  49.             this.setAppletContext(((Applet)var1).getAppletContext());
  50.             return;
  51.          }
  52.       }
  53.  
  54.    }
  55.  
  56.    protected void setAppletContext(AppletContext var1) {
  57.       this.context = var1;
  58.    }
  59. }
  60.